home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.c
- Subject: Re: Largest effective integer.
- Date: 10 Apr 1996 12:45:19 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4kh34fINNlhi@keats.ugrad.cs.ubc.ca>
- References: <4ke5gu$o7u@airdmhor.gen.nz> <4kgnm7$hma@crl.crl.com>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4kgnm7$hma@crl.crl.com>, Robert Fry <bobfry@crl.com> wrote:
- >gumboot@airdmhor.gen.nz (Simon Hosie) writes:
- >
- >> What's the highest unsigned value you can safely represent without losing
- >>integer accuracy using an ANSI defined type? For example you can get as
- >>high as 4294967295 (32 bits) using an unsigned long, or 2251800000000000ish
- >>(51 bits) using an IEEE 8 byte real, but I don't know what the minimum
- >>limits are for reals.
- >
- >The problem is, you don't know for sure that an unsigned long is 32 bits
- >or that your compiler is using an IEEE 8 byte real.
- >
- >> Basically I want a really big unsigned int and I don't care what format
- >>it's in or how slow it is.
- >
- >Check out the documentation for <limits.h>
- >
- >More important, look for MAXINT.
-
- Wrongo, It's INT_MAX. Too much Pascal coding has rotted your brain. :)
-
- And that's the largest _signed int_ value. He wants the largest possible
- unsigned value, which is ULONG_MAX, the size of the local unsigned long, which
- is guaranteed by ANSI/ISO to be at least 2^32 - 1.
-
- Incorrect answers don't do _anyone_ _any_ good, except the one who is corrected
- (and who should have read the FAQ in the first place).
- --
-
-